import Vue from 'vue'
import VueRouter from 'vue-router'
const Layout = r => require.ensure([], () => r(require('@/projects/web/pages/Layout')), 'Layout')
const Home = r => require.ensure([], () => r(require('@/projects/web/pages/Home')), 'Home')
const Note = r => require.ensure([], () => r(require('@/projects/web/pages/Note')), 'Note')
const Table = r => require.ensure([], () => r(require('@/projects/web/pages/Table')), 'Table')
const Project = r => require.ensure([], () => r(require('@/projects/web/pages/Project')), 'Project')

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: "/home",
        children: [
            {   // 首页
                path: "/home",
                name: "Home",
                component: Home, 
            },
            {   // 笔记
                path: "/note",
                name: "Note",
                component: Note, 
            },
            {   // 表格
                path: "/table",
                name: "Table",
                component: Table, 
            },
            {   // 项目
                path: "/project",
                name: "Project",
                component: Project, 
            },
        ]
    },
]

const router = new VueRouter({
    // mode: 'history',
    routes
})

export default router
